<template>
  <svg :class="svgClass" aria-hidden="true">
    <use :xlink:href="iconName" />
  </svg>
</template>

<script>
export default {
  name: "SvgIcon",
  props: {
    iconClass: {
      type: String,
      required: true
    },
    className: {
      type: String,
      default: ""
    }
  },
  computed: {
    iconName() {
      return `#icon-${this.iconClass}`;
    },
    svgClass() {
      return "svg-icon " + (this.className || "");
    }
  }
};
</script>

<style scoped>
.svg-icon {
  width: 24px;
  height: 24px;
  vertical-align: -0.15em;
  fill: rgb(145, 145, 145);
  overflow: hidden;
}
</style>
